package com.nondo.dean.product.model;

import com.nondo.dean.common.tool.BeanUtils;

public class AdminCategoryBean {
    private Integer value; // 主键ID
    private String label; // 分类名称
    private String image; // 分类图片
    private Integer pid; // 父分类ID
    private Integer orderNum; // 分类排序值

    /**
     * @return the value
     */
    public Integer getValue() {
        return value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(Integer value) {
        this.value = value;
    }

    /**
     * @return the label
     */
    public String getLabel() {
        return label;
    }

    /**
     * @param label the label to set
     */
    public void setLabel(String label) {
        this.label = label;
    }

    /**
     * @return the image
     */
    public String getImage() {
        return image;
    }

    /**
     * @param image the image to set
     */
    public void setImage(String image) {
        this.image = image;
    }

    /**
     * @return the pid
     */
    public Integer getPid() {
        return pid;
    }

    /**
     * @param pid the pid to set
     */
    public void setPid(Integer pid) {
        this.pid = pid;
    }

    /**
     * @return the orderNum
     */
    public Integer getOrderNum() {
        return orderNum;
    }

    /**
     * @param orderNum the orderNum to set
     */
    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public static AdminCategoryBean covertToBean(CategoryBean categoryBean) {
        AdminCategoryBean adminCategoryBean = new AdminCategoryBean();
        BeanUtils.copy(categoryBean, adminCategoryBean);
        adminCategoryBean.setValue(categoryBean.getId());
        adminCategoryBean.setLabel(categoryBean.getName());
        return adminCategoryBean;
    }

}
